﻿<%@ Page Language="C#" MasterPageFile="~/Demo.master" Inherits="DemoPage" Title="Using UpdatePanel show Server Dialog" %>

<%@ Register Src="~/CodeFormatter.ascx" TagName="Code" TagPrefix="demo" %>

<script runat="server">
    public void Server_OpenDialog(object sender, EventArgs e)
    {
        DemoDialog.AutoOpen = true;
    }
    
</script>

<asp:Content ID="Content1" ContentPlaceHolderID="DemoHolder" runat="Server">
    <div class="dna-state-help ui-corner-all">
        Sometimes we need to show a Dialog after PostBack. Set the <b>AutoOpen</b> property
        to "true", When the page loaded a Dialog will show automatic.
        <p>
            Dialog compatibility update for the UpdatePanel.This is very useful feautre when
            using MSAjax and DJ WebControls together.</p>
    </div>
    <br />
    <asp:UpdateProgress ID="UpdateProgress2" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
        <ProgressTemplate>
            <span>
                <div class="dna-state-loading-s">
                    <div>
                    </div>
                </div>
                Loading...</span>
        </ProgressTemplate>
    </asp:UpdateProgress>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <br />
            <br />
            <DotNetAge:SimpleButton ID="SimpleButton1" runat="server" Text="Open Dialog" OnClick="Server_OpenDialog" />
            <br />
            <DotNetAge:Dialog ID="DemoDialog" runat="server" Draggable="true" Resizable="false"
                Title="Server Dialog">
                <Buttons>
                    <DotNetAge:DialogButton Text="OK" OnClientClick="$(this).dialog('close')" />
                </Buttons>
                <BodyTemplate>
                    <div style="padding: 30px;">
                        This is a Dialog shows via Server.
                    </div>
                </BodyTemplate>
            </DotNetAge:Dialog>
        </ContentTemplate>
    </asp:UpdatePanel>
    <br />
    <br />
    <demo:Code runat="server" ID="codeView" SourceFile="~/Dialog/Codes/UpdatePanelServerDialog.aspx" />
</asp:Content>
